<?php

class Tagging extends CI_Model
{

    var $tag_id = '';
    var $product_id = '';

    function __construct()
    {
        parent::__construct();
    }

    function get_last_ten_entries()
    {
        $query = $this->db->get('User', 10);
        return $query->result();
    }

    function save()
    {
        $this->tag_id = $this->input->get('tag_id');
        $this->product_id = $this->input->get('product_id');
        $this->db->insert('Tagging', $this);

    }

    function update()
    {
        $this->tag_id = $this->input->get('tag_id');
        $this->product_id = $this->input->get('product_id');
        $this->db->update('Tagging', $this, array('id' => $this->input->post('id')));
    }

}